<template>
  <div class="App">
    <!-- 在模板上监听的事件，可以通过$event获取到形参，子组件会通过$emit将值传递给该形参-->
    <!-- <BaseSelect :city="cityId" @changeId="cityId = $event"></BaseSelect> -->
    <BaseSelect :city="cityId" @changeId="fn"></BaseSelect>
  </div>
</template>

<script>
import BaseSelect from "./components/BaseSelect.vue";
export default {
  components: {
    BaseSelect
  },
  data() {
    return {
      cityId: "103"
    };
  },
  methods: {
    fn(e) {
      console.log(e);
      this.cityId = e;
    }
  }
};
</script>

<style>
</style>